package com.travelsmart.client.apresentacao.widget;

import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.PopupPanel;
import com.google.gwt.user.client.ui.VerticalPanel;

public class FormSimplePopupPanel extends Composite{
	
	public FormSimplePopupPanel(HTML full, HTML thumb){
		super();
	    
	    final PopupPanel popup = new PopupPanel(true);
	    popup.setAnimationEnabled(true);
	    popup.ensureDebugId("cwBasicPopup-imagePopup");
	    popup.setWidget(full);
	    full.addClickHandler(new ClickHandler() {
	      public void onClick(ClickEvent event) {
	        popup.hide();
	      }
	    });
	    
	    thumb.ensureDebugId("cwBasicPopup-thumb");
	    thumb.addStyleName("cw-BasicPopup-thumb");
	    thumb.addClickHandler(new ClickHandler() {
	      public void onClick(ClickEvent event) {
	        popup.center();
	      }
	    });
	    VerticalPanel vPanel = new VerticalPanel();
	    vPanel.add(thumb);
	    initWidget(vPanel);
	}

}
